html input only numbers and special characters in textbox

116

html input only numbers and special characters in textbox -

$('.input').keyup(function () {
    if (!this.value.match(/^(\d|-)+$/)) {
        this.value = this.value.replace(/[^0-9-]/g, '');
    }
});

Comments

Submit
0 Comments